home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / pbwiz16.zip / VGADEMO.BAS < prev    next >
BASIC Source File  |  1993-02-24  |  3KB  |  94 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |         PBWIZ  Copyright (c) 1991-1993  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      PowerBASIC Wizard's Library                     |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    $DIM ARRAY
  10.  
  11.    DECLARE SUB GetDisplay (INTEGER, INTEGER)
  12.    DECLARE SUB G13Box (INTEGER, INTEGER, INTEGER, INTEGER, INTEGER)
  13.    DECLARE SUB G13Color (INTEGER, INTEGER)
  14.    DECLARE SUB G13Locate (INTEGER, INTEGER)
  15.    DECLARE SUB G13Mode (INTEGER)
  16.    DECLARE SUB G13Polygon (INTEGER, INTEGER, INTEGER, INTEGER, SINGLE)
  17.    DECLARE SUB G13Write (STRING)
  18.    DECLARE SUB G13WriteLn (STRING)
  19.    DECLARE SUB GN0Cls ()
  20.    DECLARE SUB GN0Color (INTEGER, INTEGER)
  21.    DECLARE SUB GN0Locate (INTEGER, INTEGER)
  22.    DECLARE SUB GN0Mode (INTEGER)
  23.    DECLARE SUB GN0ShowBMP (STRING, INTEGER, INTEGER, INTEGER)
  24.    DECLARE SUB GN0Write (STRING)
  25.    DECLARE SUB GN0WriteLn (STRING)
  26.  
  27.    $LINK "pbwiz.pbl"
  28.  
  29.    DEFINT A-Z
  30.  
  31.    RANDOMIZE TIMER
  32.  
  33.    CALL GetDisplay (Adapter, Mono)
  34.  
  35.    IF Adapter <> 6 THEN
  36.       PRINT "Sorry.  VGADEMO requires a VGA to run."
  37.       END
  38.    END IF
  39.  
  40.    CALL G13Mode (1)                    ' ...put into low-res VGA mode
  41.    CALL G13Color (4, 2)
  42.    CALL G13WriteLn ("PBWiz gives you access to 256-color VGA")
  43.    CALL G13Color (0, 3)
  44.    CALL G13WriteLn ("modes from  320x200 to 360x480  on any ")
  45.    CALL G13Color (7, 1)
  46.    CALL G13WriteLn ("standard VGA.   This is 320x200.   The ")
  47.    CALL G13Color (5, 8)
  48.    CALL G13WriteLn ("360x480 mode is shown on the next page.")
  49.    CALL G13WriteLn ("")
  50.    CALL G13Color (4, 14)
  51.    CALL G13WriteLn ("Full text & graphics support included. ")
  52.    FOR Y = 0 TO 31
  53.       CALL G13Color (Y + 16, 0)
  54.       CALL G13Box (Y, Y + 64, 319 - Y, (64 - Y) + 120, (Y = 100))
  55.       IF Y > 15 THEN
  56.          CALL G13Polygon (Y * 15 - 194, 112, 5, INT(RND * 6 + 1) + 2, .75 * 3.141593)
  57.          CALL G13Color (64 - Y, 0)
  58.          CALL G13Polygon (Y * 15 - 194, 136, 5, INT(RND * 6 + 1) + 2, 0)
  59.       END IF
  60.    NEXT
  61.    CALL G13Locate (25, 14)
  62.    CALL G13Color (15, 4)
  63.    CALL G13Write ("Press any key")
  64.  
  65.    DO
  66.    LOOP WHILE LEN(INKEY$)
  67.    DO
  68.       ky$ = INKEY$
  69.    LOOP UNTIL LEN(ky$)
  70.  
  71.    CALL GN0Mode (1)
  72.  
  73.    CALL GN0Cls
  74.    CALL GN0Color (50, 0)
  75.    CALL GN0WriteLn ("This is a 256-color 360 x 480 graphics mode")
  76.    CALL GN0WriteLn ("which works on any normal VGA.  It provides")
  77.    CALL GN0WriteLn ("nearly 3x the screen area of the standard")
  78.    CALL GN0WriteLn ("320 x 200  VGA high-color mode.")
  79.    CALL GN0WriteLn ("")
  80.    CALL GN0WriteLn ("You can read and write Windows bitmaps")
  81.    CALL GN0WriteLn ("(.BMP picture files) in 256 colors, too.")
  82.  
  83.    CALL GN0ShowBMP ("GDEMO.BMP", 76, 100, ErrCode)
  84.  
  85.    CALL GN0Locate (60, 6)
  86.    CALL GN0Write ("Press any key")
  87.  
  88.    DO
  89.    LOOP WHILE LEN(INKEY$)
  90.    DO
  91.    LOOP UNTIL LEN(INKEY$)
  92.  
  93.    CALL GN0Mode (0)                    ' restore text mode
  94.